const store = require("./store")

const unsubscribe = store.subscribe(() => {
    console.log("订阅数据的变化：", store.getState())
})

// 修改store中的数据：必须action
store.dispatch({ type: "change_name", name: "牢大" })
store.dispatch({ type: "change_name", name: "huashan" })

unsubscribe()

const numAction = { type: "add_number", counter: 10 }
store.dispatch(numAction)
